<template>
  <el-checkbox :value="isChecked" @change="handleChange" />
</template>

<script>
export default {
  props: ['value'],
  data() {
    return {
      isChecked: this.value
    }
  },
  watch: {
    value(newValue) {
      this.isChecked = newValue
    }
  },
  methods: {
    handleChange(newValue) {
      this.isChecked = newValue
      this.$emit('input', newValue)
    }
  }
}
</script>
